package br.com.fatec.cqr.view;

import java.awt.Color;
import java.awt.Font;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.ImageIcon;
import javax.swing.JMenu;
import javax.swing.JMenuBar;
import javax.swing.JMenuItem;
import javax.swing.JPanel;
import javax.swing.JTabbedPane;

public class MenuOpcoes extends JMenuBar {
	public MenuOpcoes() {
		final Action action = new Action();
		this.setBackground(new Color(240, 255, 255));
		JMenu menuFile = new JMenu("File");
		menuFile.setFont(new Font("Arial", Font.PLAIN, 12));
		menuFile.setBackground(new Color(240, 255, 255));
		this.add(menuFile);

		JMenuItem subNew = new JMenuItem("New");
		subNew.setFont(new Font("Arial", Font.PLAIN, 12));
		subNew.setBackground(new Color(240, 255, 255));
		menuFile.add(subNew);
		subNew.addActionListener(action);

		JMenuItem subOpen = new JMenuItem("  Open");
		subOpen.setIcon(new ImageIcon(
				Tela.class
						.getResource("/br/com/fatec/cqr/view/resources/Open Project 16x16.png")));
		subOpen.setFont(new Font("Arial", Font.PLAIN, 12));
		subOpen.setBackground(new Color(240, 255, 255));
		subOpen.addActionListener(action);
		menuFile.add(subOpen);

		JMenuItem subSave = new JMenuItem("  Save");
		subSave.setIcon(new ImageIcon(Tela.class
				.getResource("/br/com/fatec/cqr/view/resources/Save 16x16.png")));
		subSave.setFont(new Font("Arial", Font.PLAIN, 12));
		subSave.setBackground(new Color(240, 255, 255));
		subSave.addActionListener(action);
		menuFile.add(subSave);

		JMenuItem subExit = new JMenuItem(
				"Exit                                                  Alt+F4");
		subExit.setFont(new Font("Arial", Font.PLAIN, 12));
		subExit.setBackground(new Color(240, 255, 255));
		menuFile.add(subExit);
		subExit.addActionListener(action);

		JMenu menuEdit = new JMenu("Edit");
		menuEdit.setFont(new Font("Arial", Font.PLAIN, 12));
		menuEdit.setBackground(new Color(240, 255, 255));
		this.add(menuEdit);

		JMenuItem subUndo = new JMenuItem("  Undo");
		subUndo.setIcon(new ImageIcon(Tela.class
				.getResource("/br/com/fatec/cqr/view/resources/Undo 16x16.png")));
		subUndo.setFont(new Font("Arial", Font.PLAIN, 12));
		subUndo.setBackground(new Color(240, 255, 255));
		subUndo.addActionListener(new ActionListener() {

			@Override
			public void actionPerformed(ActionEvent e) {
				action.undo();
			}
		});
		menuEdit.add(subUndo);

		JMenuItem subRedo = new JMenuItem("  Redo");
		subRedo.setIcon(new ImageIcon(Tela.class
				.getResource("/br/com/fatec/cqr/view/resources/Redo 16x16.png")));
		subRedo.setFont(new Font("Arial", Font.PLAIN, 12));
		subRedo.setBackground(new Color(240, 255, 255));
		menuEdit.add(subRedo);

		subRedo.addActionListener(new ActionListener() {

			@Override
			public void actionPerformed(ActionEvent e) {
				action.redo();

			}
		});

		JMenu menuHelp = new JMenu("Help");
		menuHelp.setFont(new Font("Arial", Font.PLAIN, 12));
		menuHelp.setBackground(new Color(240, 255, 255));
		this.add(menuHelp);

		JMenuItem mntmViewHelp = new JMenuItem("  View Help");
		mntmViewHelp
				.setIcon(new ImageIcon(
						Tela.class
								.getResource("/br/com/fatec/cqr/view/resources/View Help 16x16.png")));
		mntmViewHelp.setFont(new Font("Arial", Font.PLAIN, 12));
		mntmViewHelp.setBackground(new Color(240, 255, 255));
		menuHelp.add(mntmViewHelp);
		mntmViewHelp.addActionListener(action);

		JMenuItem subAbout = new JMenuItem("About...");
		subAbout.setFont(new Font("Arial", Font.PLAIN, 12));
		subAbout.setBackground(new Color(240, 255, 255));
		menuHelp.add(subAbout);
		subAbout.addActionListener(action);
	}
}